<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>商品列表管理</title>
    <style>
        .mytb1{
            margin: auto;
            text-align: center;
            width: 400px;
        }
    </style>
</head>
<body>
<div style="text-align: center">
    <form action="/search" method="post">
        请输入商品名称：<input th:type="text" name="pname" th:value="${pname}">
        <input th:type="submit" style="width: 100px;margin-left: 5px" value="查询">

    </form>
    <br>
    <h4>查询结果如下：</h4>

</div>
<table border="1" cellspacing="0" class="mytb1">
    <tr style="background-color: lightblue">
        <th>分类编码</th>
        <th>商品名称</th>
    </tr>
    <tr th:each="commodity,iterStat:${commoditys}">
        <td th:text="${commodity.tcode}"></td>
        <td th:text="${commodity.pname}"></td>
    </tr>
</table>
</body>
</html>